package com.ruoyi.trainingManagement.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.trainingManagement.mapper.FirstLevelDisciplineMapper;
import com.ruoyi.trainingManagement.domain.FirstLevelDiscipline;
import com.ruoyi.trainingManagement.service.IFirstLevelDisciplineService;

/**
 * 一级学科目录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-23
 */
@Service
public class FirstLevelDisciplineServiceImpl implements IFirstLevelDisciplineService 
{
    @Autowired
    private FirstLevelDisciplineMapper firstLevelDisciplineMapper;

    /**
     * 查询一级学科目录
     * 
     * @param id 一级学科目录主键
     * @return 一级学科目录
     */
    @Override
    public FirstLevelDiscipline selectFirstLevelDisciplineById(String id)
    {
        return firstLevelDisciplineMapper.selectFirstLevelDisciplineById(id);
    }

    /**
     * 查询一级学科目录列表
     * 
     * @param firstLevelDiscipline 一级学科目录
     * @return 一级学科目录
     */
    @Override
    public List<FirstLevelDiscipline> selectFirstLevelDisciplineList(FirstLevelDiscipline firstLevelDiscipline)
    {
        return firstLevelDisciplineMapper.selectFirstLevelDisciplineList(firstLevelDiscipline);
    }

    /**
     * 新增一级学科目录
     * 
     * @param firstLevelDiscipline 一级学科目录
     * @return 结果
     */
    @Override
    public int insertFirstLevelDiscipline(FirstLevelDiscipline firstLevelDiscipline)
    {
        firstLevelDiscipline.setCreateTime(DateUtils.getNowDate());
        return firstLevelDisciplineMapper.insertFirstLevelDiscipline(firstLevelDiscipline);
    }

    /**
     * 修改一级学科目录
     * 
     * @param firstLevelDiscipline 一级学科目录
     * @return 结果
     */
    @Override
    public int updateFirstLevelDiscipline(FirstLevelDiscipline firstLevelDiscipline)
    {
        return firstLevelDisciplineMapper.updateFirstLevelDiscipline(firstLevelDiscipline);
    }

    /**
     * 批量删除一级学科目录
     * 
     * @param ids 需要删除的一级学科目录主键
     * @return 结果
     */
    @Override
    public int deleteFirstLevelDisciplineByIds(String[] ids)
    {
        return firstLevelDisciplineMapper.deleteFirstLevelDisciplineByIds(ids);
    }

    /**
     * 删除一级学科目录信息
     * 
     * @param id 一级学科目录主键
     * @return 结果
     */
    @Override
    public int deleteFirstLevelDisciplineById(String id)
    {
        return firstLevelDisciplineMapper.deleteFirstLevelDisciplineById(id);
    }
}
